package com.base;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.delivery.dao.WayBillDao;
import cn.itcast.bos.domain.delivery.WayBill;
import cn.itcast.bos.elasticsearch.dao.WayBillElasticSearchDao;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext.xml" })
public class test {

	@Autowired
	private WayBillDao wayBillDao;
	@Autowired
	private WayBillElasticSearchDao wayBillElasticSearchDao;
	
	@Test
	@Transactional
	public void updateElastic() {
		// TODO Auto-generated method stub
		List<WayBill> findAll = wayBillDao.findAll();
		wayBillElasticSearchDao.save(findAll);
	}
}
